{% extends 'users/usercenter-base.html' %}
{% load static %}
{% block title %}
    我的消息- 谷粒教育网
{% endblock %}
{% block breach %}
    我的消息
{% endblock %}
{% block right %}
    <div class="right">
        <div class="personal_des Releasecont">
            <div class="head">
                <h1>我的消息</h1>
            </div>

        </div>
        <div class="personal_des permessage">
            <div class="head">
                <ul class="tab_header messagehead">
                    <li class="active"><a href="{% url 'users:user_message' %}">个人消息</a></li>
                </ul>

            </div>
            <div class="messagelist">
                {% for message in msg_list %}
                    <div class="messages" msg-id="{{ message.id }}">
                        <div class="fr">
                            <div class="top"><span class="fl time">{{ message.add_time }}</span><span
                                    class="fr btn foldbtn"></span></div>
                            <p {% if not message.message_startus %}style="color: hotpink" {% endif %}>
                                {{ message.message_content }}

                            </p>
                        </div>
                    </div>
                {% endfor %}
            </div>

        </div>

    </div>
{% endblock %}
{% block user %}
{% endblock %}
{% block myjs1 %}
    <script>
        $(function () {
            $(".messages").click(function () {
                var delete_id = $(this).attr("msg-id");
                $.ajax({
                    type: "GET",
                    url: "{% url 'users:user_deletemessage' %}",
                    data: {
                        delete_id: delete_id
                    },
                    success: function (callback) {
                        if (callback.status == "ok") {
                            window.location.reload();
                        } else {
                            alert(callback.msg)
                        }
                    }
                });
            });
        });
    </script>
{% endblock %}